<?php
    use Illuminate\Support\Facades\Route;   // 使用项目路径下的路由方法


    function AdminRoutes(){  // 准备暴露的函数

        // 1测试使用
        Route::get('/admin',function(){
            return '登录成功admin';
        });

        // 身份认证分组,  ,'middleware'=>'cors'
        Route::group(['prefix'=>'admin/auth','namespace'=>'Admin'],function() {
            // 后台登录路由
            Route::post('/login', 'LoginController@login');
            Route::get('/logout', 'LoginController@logout');

            Route::post('/register', 'LoginController@register');
            Route::get('/unregister', 'LoginController@unregister');
        });

        // 管理员： 查询用户信息分组,  ,'middleware'=>'cors'
        Route::group(['prefix'=>'admin/auth','namespace'=>'Admin'],function() {
            // 后台登录路由
            Route::get('/search', 'UserController@search');
            Route::post('/searchAll', 'UserController@searchAll');
            Route::post('/searchDelAll', 'UserController@searchDelAll');
            Route::post('/searchUseAll', 'UserController@searchUseAll');

        });

    }
